<?php
/**
 * Description
 *
 * PHP version 7
 *
 * @category Custom
 * @package  Custom
 * @author   ryu <mo5467@126.com>
 * @date     2020-04-29 00:29:49
 * @lastTime 2020-05-01 23:10:53
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     none
 */
namespace Design\Behavioral\State;

class OrderContext
{

    private $state;


    public static function create() : OrderContext
    {
        $order        = new self();
        $order->state = new StateCreated();
        return $order;

    }//end create()


    public function setState(State $state)
    {
        $this->state = $state;

    }//end setState()


    public function proceedToNext()
    {
        $this->state->proceedToNext($this);

    }//end proceedToNext()


    public function toString() : string
    {
        return $this->state->toString();

    }//end toString()


}//end class
